﻿@inherits BUpload
@{
    var listType = "text";
    if (UploadType == UploadType.Image)
    {
        listType = "picture";
    }
}
<input type="hidden" @ref="hdnField" />

<div class="el-upload__tip">
    @if (Tip != null)
    {
        @Tip
    }
</div>

<div class="avatar-uploader">
    <div tabindex="0" class="el-upload el-upload--text">
        <img src="@(Files.Cast<UploadModel>().FirstOrDefault()?.Url)" class="avatar">
        <input type="file" name="file" class="el-upload__input">
    </div>
</div>
<div class="el-upload el-upload--text" onclick="window.upload(this)">
    <BButton Size="@ButtonSize.Small" IsPlain="true" Icon="el-icon-upload" Style="width:178px;" Type="ButtonType.Default">
        选择文件
    </BButton>
    <input type="file" name="file" @ref="Input" @onchange="ScanFileAsync" class="el-upload__input" />
</div>